

#include <gps.h>
#include <blink.h>
#include <serialio.h>


Gps    *gGps = NULL;



void setup()
{
    pinMode(13, OUTPUT);
    
    Serial.begin(57600);    
    Serial1.begin(38400);
    
    delay(1000);
    gGps = new Gps(Serial1, 7);
    delay(1000);
}



void loop()
{
    flash(1000, 13);
  
    if (gGps->read() == true)
    {
        Serial.print(gGps->timeString());  
        Serial.print(",");  
        Serial.print(gGps->latitudeString());  
        Serial.print(",");  
        Serial.println(gGps->longitudeString());  
    }
    
/*    
    char buf[256];
    int n = readln(Serial1, buf, 255, 10);
    if (n > 0)
    {
        buf[n] = '\0';
        Serial.println(buf);
    }
*/
}



